/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.tools;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author lenovo-pc
 */
public class MMUrlPath {
	//获取创建消息的目录
	public static String DateTimePath(Long sendtime){
		SimpleDateFormat myFmt = new SimpleDateFormat("yyyyMMdd");
		Date now = new Date(sendtime);
		return myFmt.format(now);
	}
	//获取000+Unix的创建日期后三位
	public static String UnixTimePath(Long sendtime){
		return "000"+sendtime%1000;
	}
	public static String DatePath(Long sendtime){
		return DateTimePath(sendtime)+"/"+UnixTimePath(sendtime);
	}
	public static void main(String[] args) throws ParseException {
		long l=1470453299;
		System.out.println(DatePath(l));
		SimpleDateFormat f = new SimpleDateFormat("yyyy-MM");
		System.out.println(f.parse("2000-03").getYear()+" "+ f.parse("2000-03").getMonth());
		Calendar c= Calendar.getInstance();
		System.out.println(c.get(Calendar.YEAR)+"-"+c.get(Calendar.MONTH)+"-"+c.get(Calendar.DATE));
		System.out.println(Calendar.YEAR+"-"+Calendar.MONTH+"-"+Calendar.DATE);
	}
	public static String PicPath(String str){
		return GenerateMD5.string2MD5(str)+".jpg";
		
	}
}
